// 封装一个路由
import Index from '@/views/Index'
import Vue from 'vue'
import My from '@/views/My'
import Order from '@/views/Order'
import VueRouter from 'vue-router'
import Class from '@/views/Class'
import Good from '@/views/Good'
import Eat from '@/views/Eat'
import Three from '@/views/Three'
Vue.use(VueRouter)
//规则
const router = new VueRouter({
  //更改类名简单点
  linkActiveClass: 'aa',
  linkExactActiveClass: 'bb',
  //
  routes: [
  
    {
      path: '/index', //路径
      component: Index ,//组件
      children: [
        {
          path: 'good',
          component:Good
        },
        {
          path: 'eat',
          component: Eat,
          children: [{
            path: 'three',
            component:Three
          }]
        }
      ]
    },
    {
      path: '/order',
      component:Order
    },
   
    {
      path: '/my',
      component:My
    },
    {
      path: '/class',
      component:Class
    }

  ]
})
//把router暴露出去 在main中使用
export default router